<html>
<head><meta charset="utf-8"><title>random nixos issue · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/random.20nixos.20issue.html">random nixos issue</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195188434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/random%20nixos%20issue/near/195188434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pascal <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/random.20nixos.20issue.html#195188434">(Apr 24 2020 at 13:36)</a>:</h4>
<p>hey folks, just had a very weird problem. i've solved it for now but still wanted to mention it here in case anyone else runs into it.</p>
<p>i've updated rust-analyzer (well, <code>xtask install</code>) and opened a project that has a rust-toolchain file in vscode. rust-analyzer wasn't able to load anything and errored out with a message saying it couldn't execute <code>rustc --print cfg -O</code>. turns out, i couldn't execute <code>rustc</code> at all. since i'm on nixos, i assumed this was because of some weird libc issue, which would still be surprising because i haven't touched this toolchain at all and all others worked fine. well, long story short, i tried a bunch of stuff but in the end i needed to uninstall and reinstall the toolchain, as well as rust-src (which I swear RA was able install by itself at some point).</p>



<a name="195191768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/random%20nixos%20issue/near/195191768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/random.20nixos.20issue.html#195191768">(Apr 24 2020 at 14:02)</a>:</h4>
<p>I <em>thiknk</em> a possible explanation here is that <code>rustup</code> patchelfs installed toolhcains on NixOS, and, if something like a path to interpreter changes, I think that patching might become obsolete</p>



<a name="195191845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/random%20nixos%20issue/near/195191845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/random.20nixos.20issue.html#195191845">(Apr 24 2020 at 14:02)</a>:</h4>
<p>I, I feel <code>rustup install tolchain X; sleep 10**6; sudo nixos-rebuild switch --upgrade; rustc +X --version --verbose</code> might fail in theory</p>



<a name="195198887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/random%20nixos%20issue/near/195198887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pascal <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/random.20nixos.20issue.html#195198887">(Apr 24 2020 at 14:50)</a>:</h4>
<p>that sounds very plausible! i'm tempted to try this now but i kinda need this computer to work for a few more hours <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>